/*
 * Copyright (c) 2022 Huawei Technologies Co.,Ltd.
 *
 * DMS is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 *          http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * -------------------------------------------------------------------------
 *
 * cmpt_msg_cmd.h
 *
 *
 * IDENTIFICATION
 *    src/cmpt/cmpt_msg_cmd.h
 *
 * -------------------------------------------------------------------------
 */
#ifndef __CMPT_MSG_CMD_H__
#define __CMPT_MSG_CMD_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum en_msg_command {
    MSG_REQ_BEGIN = 0,
    MSG_REQ_ASK_MASTER_FOR_PAGE = MSG_REQ_BEGIN,
    MSG_REQ_ASK_OWNER_FOR_PAGE = 1,
    MSG_REQ_INVALIDATE_SHARE_COPY = 2,
    MSG_REQ_CLAIM_OWNER = 3,
    MSG_REQ_CR_PAGE = 4,
    MSG_REQ_ASK_MASTER_FOR_CR_PAGE = 5,
    MSG_REQ_ASK_OWNER_FOR_CR_PAGE = 6,
    MSG_REQ_CHECK_VISIBLE = 7,
    MSG_REQ_TRY_ASK_MASTER_FOR_PAGE_OWNER_ID = 8,
    MSG_REQ_BROADCAST = 9,
    MSG_REQ_TXN_INFO = 10,
    MSG_REQ_TXN_SNAPSHOT = 11,
    MSG_REQ_WAIT_TXN = 12,
    MSG_REQ_AWAKE_TXN = 13,
    MSG_REQ_MASTER_CKPT_EDP = 14,
    MSG_REQ_OWNER_CKPT_EDP = 15,
    MSG_REQ_MASTER_CLEAN_EDP = 16,
    MSG_REQ_OWNER_CLEAN_EDP = 17,
    MES_REQ_MGRT_MASTER_DATA = 18,
    MSG_REQ_RELEASE_OWNER = 19,
    MSG_REQ_BOC = 20,
    MSG_REQ_SMON_DLOCK_INFO = 21,
    MSG_REQ_SMON_DEADLOCK_SQL = 22,
    MSG_REQ_SMON_DEADLOCK_ITL = 23,
    MSG_REQ_SMON_BROADCAST = 24,
    MSG_REQ_SMON_TLOCK_BY_TID = 25,
    MSG_REQ_SMON_TLOCK_BY_RM = 26,
    MSG_REQ_PAGE_REBUILD = 27,
    MSG_REQ_LOCK_REBUILD = 28,
    MSG_REQ_OPENGAUSS_TXN_STATUS = 29,
    MSG_REQ_OPENGAUSS_TXN_SNAPSHOT = 30,
    MSG_REQ_OPENGAUSS_TXN_UPDATE_XID = 31,
    MSG_REQ_OPENGAUSS_XID_CSN = 32,
    MSG_REQ_REPAIR_NEW = 33,
    MSG_REQ_SYNC_STEP = 34,
    MSG_REQ_SYNC_SHARE_INFO = 35,
    MSG_REQ_DMS_STATUS = 36,
    MSG_REQ_REFORM_PREPARE = 37,
    MSG_REQ_SYNC_NEXT_STEP = 38,
    MSG_REQ_PAGE = 39,
    MSG_REQ_SWITCHOVER = 40,
    MSG_REQ_CANCEL_REQUEST_RES = 41,
    MSG_REQ_OPENGAUSS_DDLLOCK = 42,
    MSG_REQ_CONFIRM_CVT = 43,
    MSG_REQ_CHECK_REFORM_DONE = 44,
    MSG_REQ_MAP_INFO = 45,
    MSG_REQ_DDL_SYNC = 46,
    MSG_REQ_REFORM_GCV_SYNC = 47,
    MSG_REQ_INVALID_OWNER = 48,
    MSG_REQ_ASK_RES_OWNER_ID = 49,
    MSG_REQ_OPENGAUSS_ONDEMAND_REDO = 50,
    MSG_REQ_OPENGAUSS_TXN_SWINFO = 51,
    MSG_REQ_OPENGAUSS_PAGE_STATUS = 52,
    MSG_REQ_SEND_OPENGAUSS_OLDEST_XMIN = 53,
    MSG_REQ_NODE_FOR_BUF_INFO = 54,
    MSG_REQ_PROTOCOL_MAINTAIN_VERSION = 55,
    MSG_REQ_CREATE_GLOBAL_XA_RES = 56,
    MSG_REQ_DELETE_GLOBAL_XA_RES = 57,
    MSG_REQ_ASK_XA_OWNER_ID = 58,
    MSG_REQ_END_XA = 59,
    MSG_REQ_ASK_XA_IN_USE = 60,
    MSG_REQ_XA_REBUILD = 61,
    MSG_REQ_RECYCLE = 62,
    MSG_REQ_OPENGAUSS_IMMEDIATE_CKPT = 63,
    MSG_REQ_TLOCK_REBUILD = 64,
    MSG_REQ_AZ_SWITCHOVER_DEMOTE = 65,
    MSG_REQ_AZ_SWITCHOVER_PROMOTE = 66,
    MSG_REQ_AZ_FAILOVER = 67,
    MSG_REQ_ALOCK_REBUILD = 68,
    MSG_REQ_SMON_ALOCK_BY_DRID = 69,
    MSG_REQ_CHECK_OWNERSHIP = 70,
    MSG_REQ_DRC_MIGRATE = 71,
    MSG_REQ_DRC_RELEASE = 72,
    MSG_REQ_DRM = 73,
    MSG_REQ_DRM_FINISH = 74,
    MSG_REQ_PRE_CRE_DRC = 75,
    MSG_REQ_IMCSTORE_DELTA = 76,
    MSG_REQ_END,

    MSG_ACK_BEGIN = 32768,
    MSG_ACK_CHECK_VISIBLE = MSG_ACK_BEGIN,
    MSG_ACK_PAGE_OWNER_ID = 32769,
    MSG_ACK_BROADCAST = 32770,
    MSG_ACK_BROADCAST_WITH_MSG = 32771,
    MSG_ACK_PAGE_READY = 32772,
    MSG_ACK_GRANT_OWNER = 32773,
    MSG_ACK_ALREADY_OWNER = 32774,
    MSG_ACK_CR_PAGE = 32775,
    MSG_ACK_TXN_WAIT = 32776,
    MSG_ACK_LOCK = 32777,
    MSG_ACK_TXN_INFO = 32778,
    MSG_ACK_TXN_SNAPSHOT = 32779,
    MSG_ACK_WAIT_TXN = 32780,
    MSG_ACK_AWAKE_TXN = 32781,
    MSG_ACK_MASTER_CKPT_EDP = 32782,
    MSG_ACK_OWNER_CKPT_EDP = 32783,
    MSG_ACK_MASTER_CLEAN_EDP = 32784,
    MSG_ACK_OWNER_CLEAN_EDP = 32785,
    MSG_ACK_ERROR = 32786,
    MSG_ACK_RELEASE_PAGE_OWNER = 32787,
    MSG_ACK_INVLDT_SHARE_COPY = 32788,
    MSG_ACK_BOC = 32789,
    MSG_ACK_SMON_DLOCK_INFO = 32790,
    MSG_ACK_SMON_DEADLOCK_SQL = 32791,
    MSG_ACK_SMON_DEADLOCK_ITL = 32792,
    MSG_ACK_SMON_BROADCAST = 32793,
    MSG_ACK_SMON_TLOCK_BY_TID = 32794,
    MSG_ACK_SMON_TLOCK_BY_RM = 32795,
    MSG_ACK_OPENGAUSS_TXN_STATUS = 32796,
    MSG_ACK_OPENGAUSS_TXN_SNAPSHOT = 32797,
    MES_ACK_RELEASE_OWNER_BATCH = 32798,
    MSG_ACK_OPENGAUSS_TXN_UPDATE_XID = 32799,
    MSG_ACK_OPENGAUSS_XID_CSN = 32800,
    MSG_ACK_OPENGAUSS_LOCK_BUFFER = 32801,
    MSG_ACK_SMON_ALOCK_BY_DRID = 32802,
    MSG_ACK_CHECK_OWNERSHIP = 32803,
    MSG_ACK_REFORM_COMMON = 32804,
    MSG_ACK_CONFIRM_CVT = 32805,
    MSG_ACK_MAP_INFO = 32806,
    MSG_ACK_REFORM_GCV_SYNC = 32807,
    MSG_ACK_INVLD_OWNER = 32808,
    MSG_ACK_ASK_RES_OWNER_ID = 32809,
    MSG_ACK_OPENGAUSS_ONDEMAND_REDO = 32810,
    MSG_ACK_OPENGAUSS_TXN_SWINFO = 32811,
    MSG_ACK_OPENGAUSS_PAGE_STATUS = 32812,
    MSG_ACK_SEND_OPENGAUSS_OLDEST_XMIN = 32813,
    MSG_ACK_PROTOCOL_VERSION_NOT_MATCH = 32814,
    MSG_ACK_NODE_FOR_BUF_INFO = 32815,
    MSG_ACK_CREATE_GLOBAL_XA_RES = 32816,
    MSG_ACK_DELETE_GLOBAL_XA_RES = 32817,
    MSG_ACK_ASK_XA_OWNER_ID = 32818,
    MSG_ACK_END_XA = 32819,
    MSG_ACK_XA_IN_USE = 32820,
    MSG_ACK_OPENGAUSS_IMMEDIATE_CKPT = 32821,
	MSG_ACK_DRC_MIGRATE = 32822,
    MSG_ACK_DRM_FINISH = 32823,
    MSG_ACK_IMCSTORE_DELTA = 32824,
    MSG_ACK_END,
    MSG_CMD_CEIL = MSG_ACK_END
} msg_command_t;

/* msg_command_t size */
#define DMS_REQ_CMD_SIZE (MSG_REQ_END - MSG_REQ_BEGIN)
#define DMS_ACK_CMD_SIZE (MSG_ACK_END - MSG_ACK_BEGIN)
#define DMS_CMD_SIZE (DMS_REQ_CMD_SIZE + DMS_ACK_CMD_SIZE)

#ifdef __cplusplus
}
#endif

#endif // __CMPT_MSG_CMD_H__
